package com.bookcloud.java21.chapter5.嵌套类和内部类57;

public class TestOutClass {
  public static void main(String[] args) {
    // 调用静态的嵌套类
    OuterClass.StaticNestedClass nested = new OuterClass.StaticNestedClass();
    nested.display();
    // 调用静态的嵌套类的静态方法
    OuterClass.StaticNestedClass.staticMethod();
    // 调用非静态的嵌套类
    OuterClass.NonStaticNestedClass nonStaticNested = new OuterClass().new NonStaticNestedClass();
    nonStaticNested.display();
    // 调用方法局部的嵌套类
    OuterClass outer = new OuterClass();
    outer.methodLocalNestedClass();
    // 调用匿名内部类
    outer.anonymousInnerClass();
  }
}
